# -*- coding: utf-8 -*-
"""
@Time    : 2025/3/4 20:35 
@Author  : ZhangShenao 
@File    : tools.py 
@Desc    : 工具模块
"""


def query_fruit_unit_price(fruit_name: str) -> str:
    """
    查询水果单价
    :param fruit_name: 水果名称
    :return: 水果单价
    """
    if fruit_name == "苹果":
        return "2.8"
    if fruit_name == "香蕉":
        return "1.6"
    return "未查询到该种类水果的价格"


# 可以调用的外部工具描述
TOOLS_DESCRIPTION = [
    {
        "name": "query_fruit_unit_price",
        "description": "使用该工具可以查询到指定种类水果的单价",
        "parameters": {
            "type": "object",
            "properties": {
                "fruit_name": {
                    "type": "string",
                    "description": "水果名称",
                }
            },
            "required": ["fruit_name"]
        },
    },
]
